#region Microsoft Public License
/*
 * (c) Copyright Chenjun Wu. http://utablesdk.codeplex.com
 * 
 * This source is subject to the Microsoft Public License (Ms-PL).
 * Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
 * All other rights reserved.
 */
#endregion

﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using UTable.Input;
using UTable.Input.MultiTouch;
using UTable.Objects;
using UTable.Objects.Controls;

namespace UTable.Tests
{
	/// <summary>
	/// Interaction logic for UDialogTest.xaml
	/// </summary>
	public partial class UDialogTest : UObject
	{
		public UDialogTest()
		{
			InitializeComponent();
		}

		private bool holdFocus = true;

		private void UButton_Pressed(object sender, ButtonEventArgs args)
		{
			CustomDialog.Open();
		}

		private void WarnButton_Pressed(object sender, ButtonEventArgs args)
		{
			UWarnDialog dialog = new UWarnDialog();
			dialog.Message = "This is a warm dialog";
			dialog.HoldFocus = holdFocus;
			dialog.Open();
		}

		private void ConfirmButton_Pressed(object sender, ButtonEventArgs args)
		{
			UConfirmDialog dialog = new UConfirmDialog();
			dialog.Message = "This is a confirm dialog";
			dialog.HoldFocus = holdFocus;
			dialog.Open();
		}

		private void HoldFocus_Checked(object sender, RoutedEventArgs e)
		{
			holdFocus = true;
		}

		private void HoldFocus_Unchecked(object sender, RoutedEventArgs e)
		{
			holdFocus = false;
		}

		private void UButton_Pressed_1(object sender, ButtonEventArgs args)
		{
			CustomDialog.Close();
		}
	}
}
